<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>miniFOC: hardware/led.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Acme_LOGO.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">miniFOC<span id="projectnumber">&#160;1.0.2</span>
   </div>
   <div id="projectbrief">This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_42e555215cde261dd5295a864caa3e52.html">hardware</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a>  </div>
  <div class="headertitle"><div class="title">led.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>this file contains macros for LED initialization and related IO port operations.  
<a href="#details">More...</a></p>

<p><a href="led_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a1b0a0f843bc25a0545eaa62a240ea3b2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="led_8h.html#a1b0a0f843bc25a0545eaa62a240ea3b2">led_on</a>()&#160;&#160;&#160;gpio_bit_reset(GPIOB, GPIO_PIN_5)</td></tr>
<tr class="memdesc:a1b0a0f843bc25a0545eaa62a240ea3b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">turn on LED  <a href="led_8h.html#a1b0a0f843bc25a0545eaa62a240ea3b2">More...</a><br /></td></tr>
<tr class="separator:a1b0a0f843bc25a0545eaa62a240ea3b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f2c2b803b06ac3b6a6d0a0f879eee39"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="led_8h.html#a8f2c2b803b06ac3b6a6d0a0f879eee39">led_off</a>()&#160;&#160;&#160;gpio_bit_set(GPIOB, GPIO_PIN_5)</td></tr>
<tr class="memdesc:a8f2c2b803b06ac3b6a6d0a0f879eee39"><td class="mdescLeft">&#160;</td><td class="mdescRight">turn off LED  <a href="led_8h.html#a8f2c2b803b06ac3b6a6d0a0f879eee39">More...</a><br /></td></tr>
<tr class="separator:a8f2c2b803b06ac3b6a6d0a0f879eee39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a927d8328da439f32fe78f647b70db599"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="led_8h.html#a927d8328da439f32fe78f647b70db599">led_toggle</a>()&#160;&#160;&#160;gpio_bit_write(GPIOB, GPIO_PIN_5, !gpio_output_bit_get(GPIOB, GPIO_PIN_5))</td></tr>
<tr class="memdesc:a927d8328da439f32fe78f647b70db599"><td class="mdescLeft">&#160;</td><td class="mdescRight">flip the LED pin level  <a href="led_8h.html#a927d8328da439f32fe78f647b70db599">More...</a><br /></td></tr>
<tr class="separator:a927d8328da439f32fe78f647b70db599"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cb4ec14f5c960e9fd5d5348eaf36f65"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="led_8h.html#a2cb4ec14f5c960e9fd5d5348eaf36f65">led_config</a>()</td></tr>
<tr class="memdesc:a2cb4ec14f5c960e9fd5d5348eaf36f65"><td class="mdescLeft">&#160;</td><td class="mdescRight">configure led periph and its gpios  <a href="led_8h.html#a2cb4ec14f5c960e9fd5d5348eaf36f65">More...</a><br /></td></tr>
<tr class="separator:a2cb4ec14f5c960e9fd5d5348eaf36f65"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >this file contains macros for LED initialization and related IO port operations. </p>
<dl class="section author"><dt>Author</dt><dd>Lao·Zhu </dd></dl>
<dl class="section version"><dt>Version</dt><dd>V1.0.1 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>10. October 2021 </dd></dl>

<p class="definition">Definition in file <a class="el" href="led_8h_source.html">led.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a2cb4ec14f5c960e9fd5d5348eaf36f65" name="a2cb4ec14f5c960e9fd5d5348eaf36f65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2cb4ec14f5c960e9fd5d5348eaf36f65">&#9670;&nbsp;</a></span>led_config</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define led_config</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">                        rcu_periph_clock_enable(RCU_GPIOB);\</div>
<div class="line">                        gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_5);\</div>
<div class="line">                        gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5);\</div>
<div class="line">                        led_off()</div>
</div><!-- fragment -->
<p>configure led periph and its gpios </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="led_8h_source.html#l00034">34</a> of file <a class="el" href="led_8h_source.html">led.h</a>.</p>

</div>
</div>
<a id="a8f2c2b803b06ac3b6a6d0a0f879eee39" name="a8f2c2b803b06ac3b6a6d0a0f879eee39"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f2c2b803b06ac3b6a6d0a0f879eee39">&#9670;&nbsp;</a></span>led_off</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define led_off</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;gpio_bit_set(GPIOB, GPIO_PIN_5)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>turn off LED </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="led_8h_source.html#l00022">22</a> of file <a class="el" href="led_8h_source.html">led.h</a>.</p>

</div>
</div>
<a id="a1b0a0f843bc25a0545eaa62a240ea3b2" name="a1b0a0f843bc25a0545eaa62a240ea3b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1b0a0f843bc25a0545eaa62a240ea3b2">&#9670;&nbsp;</a></span>led_on</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define led_on</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;gpio_bit_reset(GPIOB, GPIO_PIN_5)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>turn on LED </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="led_8h_source.html#l00016">16</a> of file <a class="el" href="led_8h_source.html">led.h</a>.</p>

</div>
</div>
<a id="a927d8328da439f32fe78f647b70db599" name="a927d8328da439f32fe78f647b70db599"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a927d8328da439f32fe78f647b70db599">&#9670;&nbsp;</a></span>led_toggle</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define led_toggle</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;gpio_bit_write(GPIOB, GPIO_PIN_5, !gpio_output_bit_get(GPIOB, GPIO_PIN_5))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>flip the LED pin level </p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="led_8h_source.html#l00028">28</a> of file <a class="el" href="led_8h_source.html">led.h</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>
